package com.chenfan.mcn.dao;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.chenfan.common.extension.mybatisplus.enhanced.EnhancedBaseMapper;
import com.chenfan.mcn.model.CompanyTarget;
import com.chenfan.mcn.model.McnPage;
import com.chenfan.mcn.model.dto.CompanyTargetSearchDTO;
import com.chenfan.mcn.model.vo.CompanyTargetPageVO;
import org.apache.ibatis.annotations.Param;

/**
 * <p>
 * Mapper 接口
 * </p>
 *
 * @author lizhejin
 * @since 2021-04-19
 */
public interface CompanyTargetMapper extends EnhancedBaseMapper<CompanyTarget> {

    /**
     * 公司目标分页列表
     *
     * @param mcnPage
     * @param dto
     * @return IPage<CompanyTargetPageVO> {@link CompanyTargetPageVO}
     */
    Page<CompanyTargetPageVO> getPage(McnPage<CompanyTargetPageVO> mcnPage, @Param("dto") CompanyTargetSearchDTO dto);

    /**
     * 季度销售额更新落库
     *
     * @return Integer
     */
    Integer updateQuarterSales();

    /**
     * 更新目标达成率=季度销售额/目标金额
     *
     * @return Integer
     */
    Integer updateTargetReachRate();

}
